package com.sky.mapper;

import com.sky.entity.SetmealDish;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * 套餐菜品关系
 */
@Mapper
public interface SetmealDishMapper {
    /**
     * 根据菜品id查询套餐数量
     * @param ids
     * @return
     */
    @MapKey("")
    Integer getCountById(List<Long> ids);

    /**
     * 新增套餐和菜品关系
     * @param setmealDishes
     */

    void insertsetmealDish(List<SetmealDish> setmealDishes);

    /**
     * 根据ID查询套餐菜品
     * @param id
     * @return
     */
    @Select("select * from setmeal_dish where setmeal_id = #{id}")
    List<SetmealDish> getSetMealDishById(Long id);

    /**
     * 删除套餐对应的菜品
     * @param id
     */
    @Delete("delete from setmeal_dish where setmeal_id = #{id}")
    void deletesetmealDishById(Long id);
}
